package luccy.behavior;

import luccy.desc.PropertyDesc;
import luccy.registry.Registry;

public class InjectBehavior implements Behavior, RegistryAware,
		PropertyDescAware {

	private Registry registry;

	private PropertyDesc propertyDesc;

	@SuppressWarnings("unchecked")
	public <T> T run(Class<? extends T> clazz, T t) {
		final Object object = registry.get(propertyDesc.getPropertyType());
		propertyDesc.setValue(t, object);
		return t;
	}

	public void setRegistry(Registry registry) {
		this.registry = registry;
	}

	public void setPropertyDesc(PropertyDesc propertyDesc) {
		this.propertyDesc = propertyDesc;
	}

	public <T> void destroy(Class<? extends T> clazz) {
	}

	public <T> void init(Class<? extends T> clazz) {
	}

}
